{% extends "base.volt" %}

{% block pageFooter%}
    {{ javascript_include("/assets/manage/js/bp/listTag.js", false) }}
{% endblock %}

{% block content %}
{{ partial("module/left_bp") }}
<div class="col-xs-10">
    <ol class="breadcrumb">
        <li><a href="{{ url.get('bp/list')  }}">美容院</a></li>
        <li><a href="{{ url.get('bptag/list')  }}">美容院标签管理</a></li>
        <li class="active">美容院标签列表</li>
    </ol>
    <table class="table table-hover">
        <thead>
        <tr>
            <th>ID</th>
            <th>名称</th>
            <th>状态</th>
            <th>上级</th>
            <th></th>
        </tr>
        </thead>
        {% for d in data %}
        <tr>
            <td>{{ d['tag_id'] }}</td>
            <td id="item_title_{{ d.tag_id }}">{{ d['tag_title']|e }}</td>
            <td>{{ GeneralStateValue2Str(d['tag_state']) }}</td>
            <td>{{ d['parent_name']|default("无") }}</td>
            <td>
                <div class="dropdown">
                    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu{{ d['tag_id'] }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><i class="fa fa-cogs"></i> 操作 <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" aria-labelledby="dropdownMenu{{ d['tag_id'] }}">
                        <li><a href="javascript:void(0)" did="{{ d['tag_id'] }}" durl="{{ url.get('bptag/update') }}" class="tag_update"><i class="fa fa-pencil fa-fw"></i> 修 改</a></li>
                        {% if d['tag_state'] == 1 %}
                        <li><a href="javascript:void(0)" did="{{ d['tag_id'] }}" durl="{{ url.get('bptag/setState') }}" dstate="-1" class="tag_set_state"><i class="fa fa-trash-o fa-fw"></i> 删 除</a></li>
                        {% endif %}
                        {% if d['tag_state'] == -1 %}
                        <li><a href="javascript:void(0)" did="{{ d['tag_id'] }}" durl="{{ url.get('bptag/setState') }}" dstate="1" class="tag_set_state"><i class="fa fa-reply fa-fw"></i> 恢复正常</a></li>
                        {% endif %}
                    </ul>
                </div>
            </td>
        </tr>
        {% endfor %}
    </table>
    {{ this.tagNav.page(
        page,
        total,
        limit,
        url.get('bptag/list', [
            'page': '__PAGE__'
        ]
        )) }}
</div>
{% endblock %}